Skip to content

Add GitHub Actions testing workflow#35

Merged
nathanjcochran merged 10 commits intomainfrom
nathan/test-workflow
Oct 3, 2025
Merged

Add GitHub Actions testing workflow#35
nathanjcochran merged 10 commits intomainfrom
nathan/test-workflow

Conversation

@nathanjcochran
Copy link
Member

@nathanjcochran nathanjcochran commented Oct 2, 2025

Adds a GitHub Actions workflow for building and testing the code. Also runs shellcheck on the install.sh script.

I also:

  • Fixed a race condition that appeared when the tests were run with the -race flag, which seemed to be caused by viper.WatchConfig() (possibly Data race in WatchConfig() / ReadInConfig() spf13/viper#174). Rather than relying on viper.WatchConfig() to reload the config file into viper's internal state when it changes, we now manually reload it whenever config.Load() is called. This ensures that MCP server tool calls (which always reload the config with config.Load()) will always be using the most up-to-date config state, which was the original purpose of adding viper.WatchConfig() in Fix issues with config file/directory logic #20.
  • Fixed a race in the auth tests where the test OAuth server wasn't always ready by the time we made a request to it (shows up more often in CI because the machine has more limited resources)
  • Fixed a shellcheck issue in the install.sh script that was only failing in CI, because the GitHub Actions ubuntu image users an older version of shellcheck by default (see https://www.shellcheck.net/wiki/SC2002).

Closes AGE-135

@nathanjcochran nathanjcochran self-assigned this Oct 2, 2025
@linear
Copy link

linear bot commented Oct 2, 2025

AGE-135 Tiger CLI: Add test/lint workflow to GitHub Actions

Run go test, shellcheck (for the install.sh script), linters, etc.

Comment on lines +26 to +40
- name: Install keyring dependencies
run: |
sudo apt-get update
sudo apt-get install -y gnome-keyring dbus-x11

- name: Start D-Bus and keyring
run: |
# Start D-Bus session
eval $(dbus-launch --sh-syntax)
echo "DBUS_SESSION_BUS_ADDRESS=$DBUS_SESSION_BUS_ADDRESS" >> $GITHUB_ENV

# Initialize gnome-keyring with a test password
echo 'test' | gnome-keyring-daemon --unlock
eval $(echo 'test' | gnome-keyring-daemon --start --components=secrets)
echo "GNOME_KEYRING_CONTROL=$GNOME_KEYRING_CONTROL" >> $GITHUB_ENV
Copy link
Member Author

@nathanjcochran nathanjcochran Oct 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was necessary to get the tests that rely on the keyring to pass in CI. Tbh, Claude wrote this code and I didn't take time to understand it, but it did make the tests pass 😅. It's definitely possible that some of this is wonky or unnecessary.

# Format checksum for validation: "hash filename"
local formatted_checksum
formatted_checksum=$(printf "%s %s\n" "$(cat "${checksum_file}" | tr -d '[:space:]')" "${filename}")
formatted_checksum=$(printf "%s %s\n" "$(tr -d '[:space:]' < "${checksum_file}")" "${filename}")
Copy link
Member Author

@nathanjcochran nathanjcochran Oct 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addresses https://www.shellcheck.net/wiki/SC2002, which was only showing up in CI because the GitHub Actions ubuntu image includes an older version of shellcheck, and the shellcheck docs say:

This suggestion was enabled by default up to and including ShellCheck 0.10.0.

In later versions, it is optional. It must be explicitly enabled with a directive enable=useless-use-of-cat in a # shellcheck comment or .shellcheckrc

@nathanjcochran nathanjcochran merged commit ee2c06d into main Oct 3, 2025
1 check passed
@nathanjcochran nathanjcochran deleted the nathan/test-workflow branch October 3, 2025 12:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants